const tableData = (rootId, this_) => {
    return [
        { type: "selection", clickToggle: true },
        {
            key: "code",
            label: "工单编码",
            // minWidth: 120,
            "show-overflow-tooltip": true,
        },
        {
            key: "customerName",
            label: "客户名称",
            // width: 1200,
            "show-overflow-tooltip": true,
        },
        {
            key: "status",
            label: "状态",
            width: 120,
            "show-overflow-tooltip": true,
            formatter: (r, c, v, i) => {
                const val_ = this_.$localEnum.TicketsStatusEnum.find(
                    (el) => el.value === r.status
                );
                return val_ ? val_.label : r.status;
            },
        },
        {
            key: "type",
            label: "工单类型",
            // width: 120,
            "show-overflow-tooltip": true,
            formatter: (r, c, v, i) => {
                const val_ = this_.$localEnum.TicketsTypeEnum.find(
                    (el) => el.value === r.type
                );
                return val_ ? val_.label : r.type;
            },
        },
        // {
        //   key: "ticketsCatalogName",
        //   label: "工单目录",
        //   // minWidth: 120,
        //   "show-overflow-tooltip": true,
        // },
        {
            key: "description",
            label: "工单详细描述",
            // width: 120,
        },
        {
            key: "urgency",
            label: "紧急程度",
            width: 120,
            formatter: (r, c, v, i) => {
                const val_ = this_.$localEnum.TicketsUrgencyEnum.find(
                    (el) => el.value === r.urgency
                );
                return val_ ? val_.label : r.urgency;
            },
        },
        // {
        //   key: "urgency",
        //   label: "反馈方式",
        //   // width: 120,
        //   // formatter: (r, c, v, i) => this_.$enumShow(v, "PrescriptionUnitEnum"),
        // },
        {
            key: "gmtSubmit",
            label: "提报时间",
            formatter: (r, c, v, i) => this_.$dateFormat(v),
            // width: 120,
            // formatter: (r, c, v, i) => this_.$enumShow(v, "PrescriptionUnitEnum"),
        },
        {
            key: "author",
            label: "提报人",
            // width: 120,
            // formatter: (r, c, v, i) => this_.$enumShow(v, "PrescriptionUnitEnum"),
        },
        {
            key: "userDeptName",
            label: "跟进部门",
            // width: 120,
            // formatter: (r, c, v, i) => this_.$enumShow(v, "PrescriptionUnitEnum"),
        },
        {
            key: "userRoleName",
            label: "跟进角色",
            // width: 120,
            // formatter: (r, c, v, i) => this_.$enumShow(v, "PrescriptionUnitEnum"),
        },
        {
            key: "inWhichPart",
            label: "所在环节",
            // width: 120,
            // formatter: (r, c, v, i) => this_.$enumShow(v, "PrescriptionUnitEnum"),
        },
        {
            key: "handleExpire",
            label: "处理是否已超时",
            width: 150,
            formatter: (r, c, v, i) => {
                return r.handleExpire === "Y" ? "是" : "否";
            },
        },
        {
            key: "transferExpire",
            label: "流转是否已超时",
            width: 150,
            formatter: (r, c, v, i) => {
                return r.transferExpire === "Y" ? "是" : "否";
            },
        },
        {
            type: "operate",
            width: 210,
            operate: [
                // {
                //   label: "复核",

                //   click: (row) => {},
                // },

                {
                    type: "more",
                    items: [
                        {
                            label: "label_view_detail",
                            auth: `oms_workorder_detail_${rootId}`,
                            click: (row) => {
                                this_.$router.push({
                                    path: "/page/oms/workorder/workorder_detail",
                                    query: { id: row.id },
                                });
                            },
                        },
                        {
                            label: "label_close_workorder",
                            auth: `oms_workorder_close_${rootId}`,
                            click: (row) => {
                                this_.workClose_dialog.form.default = {
                                    ticketsIds: row.id,
                                    type: row.type,
                                };
                                this_["$refs"]["workCloseRef"].show({ id: row.id });
                                this_.clearFrom("workCloseRef");
                            },
                            if: (row) => ["TO_BE_HANDLE", "TO_BE_CONFIRMED"].includes(row.status),
                        },
                        {
                            // label: "核查反馈",
                            label: "label_view_examine",
                            auth: `oms_workorder_examine_${rootId}`,
                            click: (row) => {
                                this_.onAcceptanceCatalogue(row, 2);
                            },
                            if: (row) => ["TO_BE_FEEDBACK", "TO_BE_HANDLE"].includes(row.status),
                        },
                    ],
                },
            ],
        },
    ];
}


export default tableData
